package yl.hs.bmipfull.controllers.construction;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import yl.hs.bmipfull.controllers.ControllerBase;
import yl.hs.bmipfull.service.finance.IReceivePaymentRecordService;
import yl.hs.bmipfull.viewmodels.PageQuery;
import yl.hs.bmipfull.viewmodels.WebResult;

/**
 * @author 谢东
 * @apiNote
 * @since 2022/11/16 15:54 创建
 */
@RequestMapping("/construction/PaymentRecord")
@Api(value = "工地系统", tags = "工地系统——工地结算单")
@RestController
public class ConstructionPaymentRecordController extends ControllerBase {


    @Autowired
    IReceivePaymentRecordService paymentRecordService;

    @ApiOperation(value = "查询收款记录表", notes = "分页查询收款记录表")
    @RequestMapping(value = "{rowNum}/{page}", method = RequestMethod.POST)
    public WebResult queryPage(@RequestBody PageQuery query,
                               @ApiParam(value = "页码") @PathVariable int page,
                               @ApiParam(value = "每页条数") @PathVariable int rowNum){
        try{
            var result=paymentRecordService.queryPageConstruction(query,rowNum,page);
            return success("ok",result);
        }catch(Exception ee){
            return error(ee);
        }
    }
}
